similarities between electromagnetic and mechanical waves